package com.ruoyi.project.system.device.pdf;



import com.itextpdf.text.Paragraph;

import java.util.ArrayList;
import java.util.List;

import static com.ruoyi.project.system.device.pdf.ReportFormUtil.doExecPhantomJS_deleteFileAfterException;

public class Test {

    public static void main(String[] args)
    {
        try
        {
            // 测试同时生成两张图
            // 注意：要先手动创建两个空文件G:\\test\\1.png和G:\\test\\2.png；要提前将echarts的option数据写到G:\\test\\testOption.txt和G:\\test\\testOption2.txt中
            doExecPhantomJS_deleteFileAfterException("D:\\exportPdf\\testOption.txt,D:\\exportPdf\\testOption1.txt", "D:\\exportPdf\\1.png,D:\\exportPdf\\2.png", "D:\\exportPdf\\111.png,D:\\exportPdf\\222.png");
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }

        Paragraph ph1 = ReportFormUtil.createImageParagraphByPath("1、段落标题111", "D:\\exportPdf\\111.png", 35, 35,"这是一段前缀描述信息111", "这是一段后缀描述信息111");
        Paragraph ph2 = ReportFormUtil.createImageParagraphByPath("2、段落标题222", "D:\\exportPdf\\222.png", 35, 35, "这是一段前缀描述信息222", "这是一段后缀描述信息222");

        List<Paragraph> phs = new ArrayList<Paragraph>();
        phs.add(ph1);
        phs.add(ph2);

        //ReportFormUtil.createPDFDocumentToDisk("封面名称", "小标题", "", phs, "D:\\exportPdf\\document.pdf");
    }
}
